Hack that works around firefox plugin crash
authorAlexander Larsson <alexl@redhat.com>
Sat, 4 Jul 2009 18:13:43 +0000 (20:13 +0200)
committerAlexander Larsson <alexl@redhat.com>
Sat, 4 Jul 2009 18:21:26 +0000 (20:21 +0200)
It turns out that mozilla, as per the gtk2xt code selects for input on
the socket with a mask of 0x0fffff (for god knows why) which includes
ButtonPressMask, causing a BadAccess if someone else also selects for
this. As per the client-side windows merge we always normally selects
for button press so we can emulate it on client side children that
selects for button press. However, we don't need this for GtkSocket,
so we unselect it here, fixing the crashes in firefox.

gtk/gtksocket-x11.c

index bbeb8af792fe382d3b3fc6393868e6ff52241bc5..f6f3a3d489e2e19810f0e479f063858f185fc7dc 100644 (file)
@@ -70,9 +70,17 @@ _gtk_socket_windowing_realize_window (GtkSocket *socket)
                        GDK_WINDOW_XWINDOW (window),
                        &xattrs);
 
+  /* Sooooo, it turns out that mozilla, as per the gtk2xt code selects
+     for input on the socket with a mask of 0x0fffff (for god knows why)
+     which includes ButtonPressMask causing a BadAccess if someone else
+     also selects for this. As per the client-side windows merge we always
+     normally selects for button press so we can emulate it on client
+     side children that selects for button press. However, we don't need
+     this for GtkSocket, so we unselect it here, fixing the crashes in
+     firefox. */
   XSelectInput (GDK_WINDOW_XDISPLAY (window),
                GDK_WINDOW_XWINDOW (window), 
-               xattrs.your_event_mask | 
+               (xattrs.your_event_mask & ~ButtonPressMask) |
                SubstructureNotifyMask | SubstructureRedirectMask);
 }